package be.jprojects.subscription.gui.datamodels;

import java.util.List;

import be.jprojects.subscription.logic.interfaces.IPerson;

public class PersonDataModel extends HideColumnDataModel {
	
	public PersonDataModel(List<IPerson> persons) {
		data = new Object[persons.size()][3];
		int row = 0;
		for (IPerson person : persons) {
			data[row][0] = (person.getFirstName() != null) ? person.getFirstName() : "";
			data[row][1] = (person.getLastName() != null) ? person.getLastName() : "";
			data[row][2] = (person.getMiddleName() != null) ? person.getMiddleName() : "";
			row++;
		}
		columnNames = new String[3];
		columnNames[0] = "FirstName";
		columnNames[1] = "LastName";
		columnNames[2] = "MiddleName";
		initMap(true);
	}
	
	

}
